import React, { Component } from 'react'

export default class Child extends Component {
  // #2 子组件调用父组件传递过来方法的同时并传参
  handleClick = () => {
    this.props.changeCar('奔驰')
  }
  render() {
    return (
      <div>
        <button onClick={this.handleClick}>点我，奥拓变奔驰</button>
      </div>
    )
  }
}
